<div class="grid_16 content_header clearfix">
	<h1 class="float-left">Taxes</h1>
	<div class="content_header_controls">
		<a id="addInvoice" class="link-button with-icon" href="<?php echo $this->createUrl('accounting/addtax'); ?>">
			<img src="/images/icons/fugue/document--plus.png" />
			Create Tax
		</a>
	</div>
</div>
<div class="grid_16">
    <div class="admin-accounting form">
		<div class="grid_12">
			<?php
			$this->widget('PsGridView', array(
				'id' => 'admin-taxes-grid',
				'dataProvider' => $this->getDataProviderTax($tax),
				'filter' => $tax,
				'template' => '{pager}{pagesize}{items}',
				'pagerCssClass' => 'pager float-right',
				'pagesizeCssClass' => 'pager-pagesize',
				'htmlOptions' => array(
					'class' => 'grid-view no-shadow'
				),
				'rowCssClassExpression' => '($row % 2 == 0 ? "even" : "odd")',
				'columns' => array(
					'taxType' => array(
						'header' => 'Tax Type',
						'name' => 'taxTypeName',
						'type' => 'raw',
						'value' => '$data->taxType->name', //array("class" => "bold blue link")) . "<div class=\"actions\">" . CHtml::link("Edit", array("manage/accounting/taxes", "id" => $data->id)) . "</div>"',
						'htmlOptions' => array(
							'class' => 'name',
						)
					),
					'rate' => array(
						'header' => 'Current Rate',
						'name' => 'rate',
						'type' => 'raw',
						'value' => '$data->rate',
						'htmlOptions' => array(
							'class' => 'username',
						)
					),
					'from_date' => array(
						'header' => 'Effective From',
						'name' => 'from_date',
						'type' => 'raw',
						'value' => 'Yii::app()->dateFormatter->formatDateTime(strtotime($data->from_date), "short", null)',
						'htmlOptions' => array(
							'class' => 'team',
							'width' => 150
						)
					),
//					'to_date' => array(
//						'header' => 'To',
//						'name' => 'to_date',
//						'type' => 'raw',
//						'value' => 'Yii::app()->dateFormatter->formatDateTime(strtotime($data->to_date), "short", null)',
//						'htmlOptions' => array(
//							'width' => 100
//						)
//					),
					array(
						'header' => 'Actions',
						'class' => 'common.widgets.grid.PsActionColumn', // protected/components/PsActionColumn.php
						'htmlOptions' => array(
							'class' => 'action-column',
							'width' => '100'
						),
						'options' => array(
							'width' => 150
						),
						'actions' => array(
							'spaces' => array(
								'label' => 'Edit Tax',
								'icon' => '/images/icons/farmfresh/16x16/layout_edit.png',
								'class' => 'project-action-spaces',
								'url' => array('manage/accounting/edittax', 'tax_type_id' => '$data->tax_type_id'),
							)
						)
					)
				)
			));
			?>
		</div>
    </div>
</div>